<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>

<body>
    <div id="app">
        <input type="text" v-model="num">
        <button v-on:click="num++">点赞</button>
        <button v-on:click="cancel">取消点赞</button>
        <h1>hello,{{name}},有{{num}}人为你点赞</h1>
    </div>

    <script src="../node_modules/vue/dist/vue.js"></script>
    <script>
        let vm = new Vue({
            el: "#app",
            data: {
                name: '张三',
                num: 1
            },
            methods: {
                cancel() {
                    this.num--
                }
            }
        });
    </script>

</body>

</html>